﻿using System;
using AzureCamp.Table.RssAggregatorBusiness;
namespace AzureCamp.Manager
{
    public partial class DeleteFeed : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string category = TbCategory.Text;
            string title = TbTitle.Text;

            if (String.IsNullOrEmpty(category) || String.IsNullOrEmpty(title))
            {
                LabelAnswer.Text = "Title and category must be filled!";
                return;
            }

            RSSAggregatorContext ctx = new RSSAggregatorContext();
            if (ctx.RemoveFeed(category, title))
            {
                LabelAnswer.Text = "Removed";
            }
            else
            {
                LabelAnswer.Text = "Error while removing the feed";
            }
        }
    }
}
